/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Calendar;
import java.util.Date;

/**
 * <p>Project: javaseapp - If03
 * <p>Powered by webrx On 2021-07-29 14:59:25
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class If03 {
    public static void main(String[] args) {
        var d = new Date();
        int day = d.getDay();
        if (day == 0) System.out.println("星期日");
        if (day == 1) System.out.println("星期一");
        if (day == 2) System.out.println("星期二");
        if (day == 3) System.out.println("星期三");
        if (day == 4) System.out.println("星期四");
        if (day == 5) System.out.println("星期五");
        if (day == 6) System.out.println("星期六");

        //改进程序
        if (day == 1) {
            System.out.println("星期一");
        } else if (day == 2) {
            System.out.println("星期二");
        } else if (day == 3) {
            System.out.println("星期三");
        } else if (day == 4) {
            System.out.println("星期四");
        } else if (day == 5) {
            System.out.println("星期五");
        } else if (day == 6) {
            System.out.println("星期六");
        } else {
            System.out.println("星期日");
        }
        System.out.println("今日是：星期" + "日一二三四五六".charAt(day));

        var c = Calendar.getInstance();
        int wk = c.get(Calendar.DAY_OF_WEEK) - 1;
        System.out.println("今日是：星期" + "日一二三四五六".charAt(wk));

        System.out.printf("今日是：%tA%n", System.currentTimeMillis());


    }
}
